package com.lau.videoeffect.mediaplayer

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.lau.videoeffect.R
import kotlinx.android.synthetic.main.media_player_activity.*

class MediaPlayerActivity : AppCompatActivity() {

    private lateinit var mGLVideoRenderer: GLVideoRenderer
    private lateinit var mGLVideoRenderer1: GLVideoRenderer

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.media_player_activity)
        mGLVideoRenderer = GLVideoRenderer(this, "/mnt/sdcard/video/test.mp4")
//        mGLVideoRenderer1 = GLVideoRenderer(this, "/mnt/sdcard/video/test1.mp4")
        mGLSurfaceView.setEGLContextClientVersion(3)
        mGLSurfaceView.setRenderer(mGLVideoRenderer)

//        val gLVideoRenderer = GLVideoRenderer(this, "/mnt/sdcard/video/test.mp4")
//        mGLSurfaceView2.setEGLContextClientVersion(3)
//        mGLSurfaceView2.setRenderer(gLVideoRenderer)
    }

    override fun onResume() {
        super.onResume()
        mGLVideoRenderer.onResume()
    }

    override fun onPause() {
        super.onPause()
        mGLVideoRenderer.onPause()
    }

    override fun onStop() {
        super.onStop()
        mGLVideoRenderer.onRelease()
    }

}